home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / fracii.doc < prev    next >
Text File  |  1995-03-31  |  2KB  |  85 lines

  1. (Comp.sys.hp48) 
  2. Item: 396 by detlef@mwhh.hanse.de 
  3. Author: [Romain Desplats] 
  4.   Subj: Fraction library 
  5.   Date: Mon Dec 16 1991 
  6.  
  7. Hi. 
  8.  
  9. I post this article for a friend of mine who has no news access. Please 
  10. reply to him, not to me, if there are any questions/comments about the 
  11. software. 
  12.  
  13. Bye, 
  14.           8-),Detlef 
  15. ----------------------------------------------------------------------------- 
  16.  
  17.  
  18. FRACTION LIBRARY 
  19.  
  20.  
  21. -  This is a new "Frac" lib written originally in RPL then converted into ML 
  22. routines. 
  23.  
  24. -  This version is quick and small (in terms of memory). 
  25.  
  26. -  I am not going to describe the advantages of ML versus RPL anymore.  Let's 
  27. look at the contents of this library. 
  28.  
  29. RX       : Takes any numbers, list, algebraic, array of 
  30.            numbers and the program you want to apply to that object. 
  31.         eg. :       2:[[.1 .2]]                 
  32.                     1:<<->Q>>                T:.25_ms 
  33.         output      {{1/10 1/5}}             T:'1/4'*1_ms 
  34.  
  35.         Note that arrays would be converted into lists if you didn't 
  36.         have reals or complex anymore. 
  37.  
  38. EC       : Works with list to fully expand and fully collect. 
  39.            (Never gets stuck with the fully expand) 
  40.  
  41. PGCD  :  Called by S~a     12 : { 2 2 3 } 
  42.  
  43. S~a     :  Gets you : 
  44.             a/b square root c/d 
  45.             as 1/3 square root 2/3 
  46.           from a number 
  47.  
  48.          but also tries to get pi or 1/pi as a fraction. 
  49.  
  50.  
  51.         [ [1 .866 0]                 { {1  û3/2 0} 
  52.           [.866 1 0]                   {û3/2  1 0} 
  53.           [0   0  1] ]                 {0    1     0} } 
  54.  
  55.  
  56.         90degre:1.5707_rad 90degre:pi/2*1_rad 
  57.  
  58.  
  59.          Note : this works for numbers (xl<1/308) because of pi. 
  60.  
  61. FR       :  Return one single fraction 
  62.             u+inv(A)/cosx/sinx/3 = ... 
  63.             works with lists 
  64.  
  65.         try something like this: { { INV(x) }  A+A/B } 
  66.  
  67. LX      :   Then there is the LX program which works about the same way 
  68.             with lists.  Apply a program to all arguments of a list : 
  69.  
  70.         eg. : {x { x2 } cosx} 
  71.         << / 2 >> 
  72.  
  73. RN         :  Tries to cancel machine rounding errors (it works as RX) 
  74.       IN  {-0. 99999 [1.23456 1.20001]} 
  75.       OUT  {-0.1 [1.23456 1.2]} 
  76.  
  77.  
  78. have fun and e-mail me for any comments at 
  79.  
  80. dehon@platon.greco-prog.fr 
  81.  
  82.  
  83.  
  84. Romain Desplats 
  85.